﻿using System;
namespace Producers.Rr.Xtee.Riik.Ee.Producer.Rr {
    
    
    [global::Xtee.Core.Attributes.XmlTypeAttribute(Name="RR62Response", Namespace="http://producers.rr.xtee.riik.ee/producer/rr", Target=typeof(RR62Response))]
    public class RR62ResponseSerializer : global::Xtee.Core.Types.AbstractXteeSerializable {
        
        protected IRR62Response clazz;
        
        public RR62ResponseSerializer(IRR62Response clazz) {
            this.clazz = clazz;
        }
        
        public override void WriteXml(global::Xtee.Core.IXteeXmlWriter Writer) {
            base.WriteXml(Writer);
            Writer.WriteStartElement("veakood");
            Writer.WriteTypeAttribute("http://www.w3.org/2001/XMLSchema", "integer");
            Writer.WriteString(new global::Xtee.Core.Schema.XsdInteger(((decimal)(clazz.Veakood))).ToString());
            Writer.WriteEndElement();
            Writer.WriteStartElement("veatekst");
            if (clazz.Veatekst!=null) {
                Writer.WriteTypeAttribute("http://www.w3.org/2001/XMLSchema", "string");
                Writer.WriteString(new global::Xtee.Core.Schema.XsdString(((string)(clazz.Veatekst))).ToString());
            }
            else {
                throw new global::Xtee.Core.Exceptions.NillableNotAllowedException("Nullable is not allowed for element : Veatekst");
            }
            Writer.WriteEndElement();
            Writer.WriteStartElement("Isik");
            if (clazz.Isik!=null) {
                Writer.WriteTypeAttribute("http://schemas.xmlsoap.org/soap/encoding/", "Array");
                Writer.WriteArrayTypeAttribute(">>>RR62Response>Isik>Isik", "http://producers.rr.xtee.riik.ee/producer/rr", clazz.Isik.Count);
                for (int x = 0; ((clazz.Isik != null) 
                            && (x < clazz.Isik.Count)); x = (x + 1)) {
                    if (clazz.Isik[x]!=null) {
                        Writer.WriteStartElement("Isik");
                        global::Xtee.Core.SerializationMetadata metaIsik = this.GetMetaData(clazz.Isik[x]);
                        Writer.WriteTypeAttribute(metaIsik.TypeQualifiedName.Namespace, metaIsik.TypeQualifiedName.Name);
                        metaIsik.NewSerializer(clazz.Isik[x]).WriteXml(Writer);
                        Writer.WriteEndElement();
                    }
                }
            }
            else {
                throw new global::Xtee.Core.Exceptions.NillableNotAllowedException("Nullable is not allowed for element : Isik");
            }
            Writer.WriteEndElement();
            Writer.WriteStartElement("Dok");
            if (clazz.Dok!=null) {
                Writer.WriteTypeAttribute("http://schemas.xmlsoap.org/soap/encoding/", "Array");
                Writer.WriteArrayTypeAttribute(">>>RR62Response>Dok>Dok", "http://producers.rr.xtee.riik.ee/producer/rr", clazz.Dok.Count);
                for (int x = 0; ((clazz.Dok != null) 
                            && (x < clazz.Dok.Count)); x = (x + 1)) {
                    if (clazz.Dok[x]!=null) {
                        Writer.WriteStartElement("Dok");
                        global::Xtee.Core.SerializationMetadata metaDok = this.GetMetaData(clazz.Dok[x]);
                        Writer.WriteTypeAttribute(metaDok.TypeQualifiedName.Namespace, metaDok.TypeQualifiedName.Name);
                        metaDok.NewSerializer(clazz.Dok[x]).WriteXml(Writer);
                        Writer.WriteEndElement();
                    }
                }
            }
            else {
                throw new global::Xtee.Core.Exceptions.NillableNotAllowedException("Nullable is not allowed for element : Dok");
            }
            Writer.WriteEndElement();
        }
        
        public override void ReadXml(global::Xtee.Core.IXteeXmlReader Reader) {
            base.ReadXml(Reader);
            if (Reader.LocalName=="veakood") {
                if (Reader.IsElementNil()) {
                    throw new global::Xtee.Core.Exceptions.NillableNotAllowedException(">>RR62Response>veakood");
                }
                clazz.Veakood = new global::Xtee.Core.Schema.XsdInteger(Reader.ReadElementString("veakood")).Value;
            }
            else {
                throw new global::Xtee.Core.Exceptions.UnExpectedElementException(">>RR62Response>veakood", Reader.LocalName);
            }
            if (Reader.LocalName=="veatekst") {
                if (Reader.IsElementNil()) {
                    throw new global::Xtee.Core.Exceptions.NillableNotAllowedException(">>RR62Response>veatekst");
                }
                clazz.Veatekst = new global::Xtee.Core.Schema.XsdString(Reader.ReadElementString("veatekst")).Value;
            }
            else {
                throw new global::Xtee.Core.Exceptions.UnExpectedElementException(">>RR62Response>veatekst", Reader.LocalName);
            }
            if (Reader.LocalName=="Isik") {
                if (Reader.IsElementNil()) {
                    throw new global::Xtee.Core.Exceptions.NillableNotAllowedException(">>RR62Response>Isik");
                }
                clazz.Isik = new System.Collections.Generic.List<RR62Response.IIsikType>();
                if ((Reader.IsEmptyElement == false)) {
                    Reader.ReadStartElement("Isik");
                    for (; ((Reader.NodeType != System.Xml.XmlNodeType.EndElement) 
                                && (Reader.LocalName == "Isik")); ) {
                        if (Reader.IsElementNil()) {
                            throw new global::Xtee.Core.Exceptions.NillableNotAllowedException(">>>RR62Response>Isik>Isik");
                        }
                        global::Xtee.Core.SerializationMetadata metaIsik = this.GetMetaData<RR62Response.IIsikType>(Reader, ">>>RR62Response>Isik>Isik", "http://producers.rr.xtee.riik.ee/producer/rr");
                        RR62Response.IIsikType item = metaIsik.NewEntity<RR62Response.IIsikType>();
                        clazz.Isik.Add(item);
                        if ((Reader.IsEmptyElement == false)) {
                            Reader.ReadStartElement("Isik");
                            metaIsik.NewSerializer(item).ReadXml(Reader);
                            Reader.ReadEndElement();
                        }
                        else {
                            Reader.Skip();
                        }
                    }
                    Reader.ReadEndElement();
                }
                else {
                    Reader.Skip();
                }
            }
            else {
                throw new global::Xtee.Core.Exceptions.UnExpectedElementException(">>RR62Response>Isik", Reader.LocalName);
            }
            if (Reader.LocalName=="Dok") {
                if (Reader.IsElementNil()) {
                    throw new global::Xtee.Core.Exceptions.NillableNotAllowedException(">>RR62Response>Dok");
                }
                clazz.Dok = new System.Collections.Generic.List<RR62Response.IDokType>();
                if ((Reader.IsEmptyElement == false)) {
                    Reader.ReadStartElement("Dok");
                    for (; ((Reader.NodeType != System.Xml.XmlNodeType.EndElement) 
                                && (Reader.LocalName == "Dok")); ) {
                        if (Reader.IsElementNil()) {
                            throw new global::Xtee.Core.Exceptions.NillableNotAllowedException(">>>RR62Response>Dok>Dok");
                        }
                        global::Xtee.Core.SerializationMetadata metaDok = this.GetMetaData<RR62Response.IDokType>(Reader, ">>>RR62Response>Dok>Dok", "http://producers.rr.xtee.riik.ee/producer/rr");
                        RR62Response.IDokType item = metaDok.NewEntity<RR62Response.IDokType>();
                        clazz.Dok.Add(item);
                        if ((Reader.IsEmptyElement == false)) {
                            Reader.ReadStartElement("Dok");
                            metaDok.NewSerializer(item).ReadXml(Reader);
                            Reader.ReadEndElement();
                        }
                        else {
                            Reader.Skip();
                        }
                    }
                    Reader.ReadEndElement();
                }
                else {
                    Reader.Skip();
                }
            }
            else {
                throw new global::Xtee.Core.Exceptions.UnExpectedElementException(">>RR62Response>Dok", Reader.LocalName);
            }
        }
        
        [global::Xtee.Core.Attributes.XmlTypeAttribute(Name=">>>RR62Response>Isik>Isik", Namespace="http://producers.rr.xtee.riik.ee/producer/rr", Target=typeof(RR62Response.IsikType))]
        public class IsikTypeSerializer : global::Xtee.Core.Types.AbstractXteeSerializable {
            
            protected RR62Response.IIsikType clazz;
            
            public IsikTypeSerializer(RR62Response.IIsikType clazz) {
                this.clazz = clazz;
            }
            
            public override void WriteXml(global::Xtee.Core.IXteeXmlWriter Writer) {
                base.WriteXml(Writer);
                Writer.WriteStartElement("Isik.Isikukood");
                if (clazz.IsikIsikukood!=null) {
                    Writer.WriteTypeAttribute("http://www.w3.org/2001/XMLSchema", "string");
                    Writer.WriteString(new global::Xtee.Core.Schema.XsdString(((string)(clazz.IsikIsikukood))).ToString());
                }
                else {
                    throw new global::Xtee.Core.Exceptions.NillableNotAllowedException("Nullable is not allowed for element : IsikIsikukood");
                }
                Writer.WriteEndElement();
                Writer.WriteStartElement("Isik.Perenimi");
                if (clazz.IsikPerenimi!=null) {
                    Writer.WriteTypeAttribute("http://www.w3.org/2001/XMLSchema", "string");
                    Writer.WriteString(new global::Xtee.Core.Schema.XsdString(((string)(clazz.IsikPerenimi))).ToString());
                }
                else {
                    throw new global::Xtee.Core.Exceptions.NillableNotAllowedException("Nullable is not allowed for element : IsikPerenimi");
                }
                Writer.WriteEndElement();
                Writer.WriteStartElement("Isik.Eesnimi");
                if (clazz.IsikEesnimi!=null) {
                    Writer.WriteTypeAttribute("http://www.w3.org/2001/XMLSchema", "string");
                    Writer.WriteString(new global::Xtee.Core.Schema.XsdString(((string)(clazz.IsikEesnimi))).ToString());
                }
                else {
                    throw new global::Xtee.Core.Exceptions.NillableNotAllowedException("Nullable is not allowed for element : IsikEesnimi");
                }
                Writer.WriteEndElement();
                Writer.WriteStartElement("Isik.Vallakd");
                if (clazz.IsikVallakd!=null) {
                    Writer.WriteTypeAttribute("http://www.w3.org/2001/XMLSchema", "string");
                    Writer.WriteString(new global::Xtee.Core.Schema.XsdString(((string)(clazz.IsikVallakd))).ToString());
                }
                else {
                    throw new global::Xtee.Core.Exceptions.NillableNotAllowedException("Nullable is not allowed for element : IsikVallakd");
                }
                Writer.WriteEndElement();
                Writer.WriteStartElement("Isik.Kylakd");
                if (clazz.IsikKylakd!=null) {
                    Writer.WriteTypeAttribute("http://www.w3.org/2001/XMLSchema", "string");
                    Writer.WriteString(new global::Xtee.Core.Schema.XsdString(((string)(clazz.IsikKylakd))).ToString());
                }
                else {
                    throw new global::Xtee.Core.Exceptions.NillableNotAllowedException("Nullable is not allowed for element : IsikKylakd");
                }
                Writer.WriteEndElement();
                Writer.WriteStartElement("Isik.Vaikekoht");
                if (clazz.IsikVaikekoht!=null) {
                    Writer.WriteTypeAttribute("http://www.w3.org/2001/XMLSchema", "string");
                    Writer.WriteString(new global::Xtee.Core.Schema.XsdString(((string)(clazz.IsikVaikekoht))).ToString());
                }
                else {
                    throw new global::Xtee.Core.Exceptions.NillableNotAllowedException("Nullable is not allowed for element : IsikVaikekoht");
                }
                Writer.WriteEndElement();
                Writer.WriteStartElement("Isik.Tanavakd");
                if (clazz.IsikTanavakd!=null) {
                    Writer.WriteTypeAttribute("http://www.w3.org/2001/XMLSchema", "string");
                    Writer.WriteString(new global::Xtee.Core.Schema.XsdString(((string)(clazz.IsikTanavakd))).ToString());
                }
                else {
                    throw new global::Xtee.Core.Exceptions.NillableNotAllowedException("Nullable is not allowed for element : IsikTanavakd");
                }
                Writer.WriteEndElement();
                Writer.WriteStartElement("Isik.Tanavanm");
                if (clazz.IsikTanavanm!=null) {
                    Writer.WriteTypeAttribute("http://www.w3.org/2001/XMLSchema", "string");
                    Writer.WriteString(new global::Xtee.Core.Schema.XsdString(((string)(clazz.IsikTanavanm))).ToString());
                }
                else {
                    throw new global::Xtee.Core.Exceptions.NillableNotAllowedException("Nullable is not allowed for element : IsikTanavanm");
                }
                Writer.WriteEndElement();
                Writer.WriteStartElement("Isik.Nimi");
                if (clazz.IsikNimi!=null) {
                    Writer.WriteTypeAttribute("http://www.w3.org/2001/XMLSchema", "string");
                    Writer.WriteString(new global::Xtee.Core.Schema.XsdString(((string)(clazz.IsikNimi))).ToString());
                }
                else {
                    throw new global::Xtee.Core.Exceptions.NillableNotAllowedException("Nullable is not allowed for element : IsikNimi");
                }
                Writer.WriteEndElement();
                Writer.WriteStartElement("Isik.Majanr");
                if (clazz.IsikMajanr!=null) {
                    Writer.WriteTypeAttribute("http://www.w3.org/2001/XMLSchema", "string");
                    Writer.WriteString(new global::Xtee.Core.Schema.XsdString(((string)(clazz.IsikMajanr))).ToString());
                }
                else {
                    throw new global::Xtee.Core.Exceptions.NillableNotAllowedException("Nullable is not allowed for element : IsikMajanr");
                }
                Writer.WriteEndElement();
                Writer.WriteStartElement("Isik.Korternr");
                if (clazz.IsikKorternr!=null) {
                    Writer.WriteTypeAttribute("http://www.w3.org/2001/XMLSchema", "string");
                    Writer.WriteString(new global::Xtee.Core.Schema.XsdString(((string)(clazz.IsikKorternr))).ToString());
                }
                else {
                    throw new global::Xtee.Core.Exceptions.NillableNotAllowedException("Nullable is not allowed for element : IsikKorternr");
                }
                Writer.WriteEndElement();
                Writer.WriteStartElement("Isik.Viimatipar");
                if (clazz.IsikViimatipar!=null) {
                    Writer.WriteTypeAttribute("http://www.w3.org/2001/XMLSchema", "string");
                    Writer.WriteString(new global::Xtee.Core.Schema.XsdString(((string)(clazz.IsikViimatipar))).ToString());
                }
                else {
                    throw new global::Xtee.Core.Exceptions.NillableNotAllowedException("Nullable is not allowed for element : IsikViimatipar");
                }
                Writer.WriteEndElement();
                Writer.WriteStartElement("Isik.Mperenm");
                if (clazz.IsikMperenm!=null) {
                    Writer.WriteTypeAttribute("http://www.w3.org/2001/XMLSchema", "string");
                    Writer.WriteString(new global::Xtee.Core.Schema.XsdString(((string)(clazz.IsikMperenm))).ToString());
                }
                else {
                    throw new global::Xtee.Core.Exceptions.NillableNotAllowedException("Nullable is not allowed for element : IsikMperenm");
                }
                Writer.WriteEndElement();
                Writer.WriteStartElement("Isik.Meesnm");
                if (clazz.IsikMeesnm!=null) {
                    Writer.WriteTypeAttribute("http://www.w3.org/2001/XMLSchema", "string");
                    Writer.WriteString(new global::Xtee.Core.Schema.XsdString(((string)(clazz.IsikMeesnm))).ToString());
                }
                else {
                    throw new global::Xtee.Core.Exceptions.NillableNotAllowedException("Nullable is not allowed for element : IsikMeesnm");
                }
                Writer.WriteEndElement();
                Writer.WriteStartElement("Isik.IsikKoda");
                if (clazz.IsikIsikKoda!=null) {
                    Writer.WriteTypeAttribute("http://www.w3.org/2001/XMLSchema", "string");
                    Writer.WriteString(new global::Xtee.Core.Schema.XsdString(((string)(clazz.IsikIsikKoda))).ToString());
                }
                else {
                    throw new global::Xtee.Core.Exceptions.NillableNotAllowedException("Nullable is not allowed for element : IsikIsikKoda");
                }
                Writer.WriteEndElement();
                Writer.WriteStartElement("Isik.SaabEestisse");
                if (clazz.IsikSaabEestisse!=null) {
                    Writer.WriteTypeAttribute("http://www.w3.org/2001/XMLSchema", "string");
                    Writer.WriteString(new global::Xtee.Core.Schema.XsdString(((string)(clazz.IsikSaabEestisse))).ToString());
                }
                else {
                    throw new global::Xtee.Core.Exceptions.NillableNotAllowedException("Nullable is not allowed for element : IsikSaabEestisse");
                }
                Writer.WriteEndElement();
                Writer.WriteStartElement("Isik.Postiindeks");
                if (clazz.IsikPostiindeks!=null) {
                    Writer.WriteTypeAttribute("http://www.w3.org/2001/XMLSchema", "string");
                    Writer.WriteString(new global::Xtee.Core.Schema.XsdString(((string)(clazz.IsikPostiindeks))).ToString());
                }
                else {
                    throw new global::Xtee.Core.Exceptions.NillableNotAllowedException("Nullable is not allowed for element : IsikPostiindeks");
                }
                Writer.WriteEndElement();
                Writer.WriteStartElement("Isik.ElukRegpe");
                if (clazz.IsikElukRegpe!=null) {
                    Writer.WriteTypeAttribute("http://www.w3.org/2001/XMLSchema", "string");
                    Writer.WriteString(new global::Xtee.Core.Schema.XsdString(((string)(clazz.IsikElukRegpe))).ToString());
                }
                else {
                    throw new global::Xtee.Core.Exceptions.NillableNotAllowedException("Nullable is not allowed for element : IsikElukRegpe");
                }
                Writer.WriteEndElement();
                Writer.WriteStartElement("Isik.IsikuStaatus");
                if (clazz.IsikIsikuStaatus!=null) {
                    Writer.WriteTypeAttribute("http://www.w3.org/2001/XMLSchema", "string");
                    Writer.WriteString(new global::Xtee.Core.Schema.XsdString(((string)(clazz.IsikIsikuStaatus))).ToString());
                }
                else {
                    throw new global::Xtee.Core.Exceptions.NillableNotAllowedException("Nullable is not allowed for element : IsikIsikuStaatus");
                }
                Writer.WriteEndElement();
                Writer.WriteStartElement("Isik.KirjeStaatus");
                if (clazz.IsikKirjeStaatus!=null) {
                    Writer.WriteTypeAttribute("http://www.w3.org/2001/XMLSchema", "string");
                    Writer.WriteString(new global::Xtee.Core.Schema.XsdString(((string)(clazz.IsikKirjeStaatus))).ToString());
                }
                else {
                    throw new global::Xtee.Core.Exceptions.NillableNotAllowedException("Nullable is not allowed for element : IsikKirjeStaatus");
                }
                Writer.WriteEndElement();
                Writer.WriteStartElement("Isik.Synniaeg");
                if (clazz.IsikSynniaeg!=null) {
                    Writer.WriteTypeAttribute("http://www.w3.org/2001/XMLSchema", "string");
                    Writer.WriteString(new global::Xtee.Core.Schema.XsdString(((string)(clazz.IsikSynniaeg))).ToString());
                }
                else {
                    throw new global::Xtee.Core.Exceptions.NillableNotAllowedException("Nullable is not allowed for element : IsikSynniaeg");
                }
                Writer.WriteEndElement();
                Writer.WriteStartElement("Isik.Surmaaeg");
                if (clazz.IsikSurmaaeg!=null) {
                    Writer.WriteTypeAttribute("http://www.w3.org/2001/XMLSchema", "string");
                    Writer.WriteString(new global::Xtee.Core.Schema.XsdString(((string)(clazz.IsikSurmaaeg))).ToString());
                }
                else {
                    throw new global::Xtee.Core.Exceptions.NillableNotAllowedException("Nullable is not allowed for element : IsikSurmaaeg");
                }
                Writer.WriteEndElement();
            }
            
            public override void ReadXml(global::Xtee.Core.IXteeXmlReader Reader) {
                base.ReadXml(Reader);
                if (Reader.LocalName=="Isik.Isikukood") {
                    if (Reader.IsElementNil()) {
                        throw new global::Xtee.Core.Exceptions.NillableNotAllowedException(">>>>RR62Response>Isik>Isik>Isik.Isikukood");
                    }
                    clazz.IsikIsikukood = new global::Xtee.Core.Schema.XsdString(Reader.ReadElementString("Isik.Isikukood")).Value;
                }
                else {
                    throw new global::Xtee.Core.Exceptions.UnExpectedElementException(">>>>RR62Response>Isik>Isik>Isik.Isikukood", Reader.LocalName);
                }
                if (Reader.LocalName=="Isik.Perenimi") {
                    if (Reader.IsElementNil()) {
                        throw new global::Xtee.Core.Exceptions.NillableNotAllowedException(">>>>RR62Response>Isik>Isik>Isik.Perenimi");
                    }
                    clazz.IsikPerenimi = new global::Xtee.Core.Schema.XsdString(Reader.ReadElementString("Isik.Perenimi")).Value;
                }
                else {
                    throw new global::Xtee.Core.Exceptions.UnExpectedElementException(">>>>RR62Response>Isik>Isik>Isik.Perenimi", Reader.LocalName);
                }
                if (Reader.LocalName=="Isik.Eesnimi") {
                    if (Reader.IsElementNil()) {
                        throw new global::Xtee.Core.Exceptions.NillableNotAllowedException(">>>>RR62Response>Isik>Isik>Isik.Eesnimi");
                    }
                    clazz.IsikEesnimi = new global::Xtee.Core.Schema.XsdString(Reader.ReadElementString("Isik.Eesnimi")).Value;
                }
                else {
                    throw new global::Xtee.Core.Exceptions.UnExpectedElementException(">>>>RR62Response>Isik>Isik>Isik.Eesnimi", Reader.LocalName);
                }
                if (Reader.LocalName=="Isik.Vallakd") {
                    if (Reader.IsElementNil()) {
                        throw new global::Xtee.Core.Exceptions.NillableNotAllowedException(">>>>RR62Response>Isik>Isik>Isik.Vallakd");
                    }
                    clazz.IsikVallakd = new global::Xtee.Core.Schema.XsdString(Reader.ReadElementString("Isik.Vallakd")).Value;
                }
                else {
                    throw new global::Xtee.Core.Exceptions.UnExpectedElementException(">>>>RR62Response>Isik>Isik>Isik.Vallakd", Reader.LocalName);
                }
                if (Reader.LocalName=="Isik.Kylakd") {
                    if (Reader.IsElementNil()) {
                        throw new global::Xtee.Core.Exceptions.NillableNotAllowedException(">>>>RR62Response>Isik>Isik>Isik.Kylakd");
                    }
                    clazz.IsikKylakd = new global::Xtee.Core.Schema.XsdString(Reader.ReadElementString("Isik.Kylakd")).Value;
                }
                else {
                    throw new global::Xtee.Core.Exceptions.UnExpectedElementException(">>>>RR62Response>Isik>Isik>Isik.Kylakd", Reader.LocalName);
                }
                if (Reader.LocalName=="Isik.Vaikekoht") {
                    if (Reader.IsElementNil()) {
                        throw new global::Xtee.Core.Exceptions.NillableNotAllowedException(">>>>RR62Response>Isik>Isik>Isik.Vaikekoht");
                    }
                    clazz.IsikVaikekoht = new global::Xtee.Core.Schema.XsdString(Reader.ReadElementString("Isik.Vaikekoht")).Value;
                }
                else {
                    throw new global::Xtee.Core.Exceptions.UnExpectedElementException(">>>>RR62Response>Isik>Isik>Isik.Vaikekoht", Reader.LocalName);
                }
                if (Reader.LocalName=="Isik.Tanavakd") {
                    if (Reader.IsElementNil()) {
                        throw new global::Xtee.Core.Exceptions.NillableNotAllowedException(">>>>RR62Response>Isik>Isik>Isik.Tanavakd");
                    }
                    clazz.IsikTanavakd = new global::Xtee.Core.Schema.XsdString(Reader.ReadElementString("Isik.Tanavakd")).Value;
                }
                else {
                    throw new global::Xtee.Core.Exceptions.UnExpectedElementException(">>>>RR62Response>Isik>Isik>Isik.Tanavakd", Reader.LocalName);
                }
                if (Reader.LocalName=="Isik.Tanavanm") {
                    if (Reader.IsElementNil()) {
                        throw new global::Xtee.Core.Exceptions.NillableNotAllowedException(">>>>RR62Response>Isik>Isik>Isik.Tanavanm");
                    }
                    clazz.IsikTanavanm = new global::Xtee.Core.Schema.XsdString(Reader.ReadElementString("Isik.Tanavanm")).Value;
                }
                else {
                    throw new global::Xtee.Core.Exceptions.UnExpectedElementException(">>>>RR62Response>Isik>Isik>Isik.Tanavanm", Reader.LocalName);
                }
                if (Reader.LocalName=="Isik.Nimi") {
                    if (Reader.IsElementNil()) {
                        throw new global::Xtee.Core.Exceptions.NillableNotAllowedException(">>>>RR62Response>Isik>Isik>Isik.Nimi");
                    }
                    clazz.IsikNimi = new global::Xtee.Core.Schema.XsdString(Reader.ReadElementString("Isik.Nimi")).Value;
                }
                else {
                    throw new global::Xtee.Core.Exceptions.UnExpectedElementException(">>>>RR62Response>Isik>Isik>Isik.Nimi", Reader.LocalName);
                }
                if (Reader.LocalName=="Isik.Majanr") {
                    if (Reader.IsElementNil()) {
                        throw new global::Xtee.Core.Exceptions.NillableNotAllowedException(">>>>RR62Response>Isik>Isik>Isik.Majanr");
                    }
                    clazz.IsikMajanr = new global::Xtee.Core.Schema.XsdString(Reader.ReadElementString("Isik.Majanr")).Value;
                }
                else {
                    throw new global::Xtee.Core.Exceptions.UnExpectedElementException(">>>>RR62Response>Isik>Isik>Isik.Majanr", Reader.LocalName);
                }
                if (Reader.LocalName=="Isik.Korternr") {
                    if (Reader.IsElementNil()) {
                        throw new global::Xtee.Core.Exceptions.NillableNotAllowedException(">>>>RR62Response>Isik>Isik>Isik.Korternr");
                    }
                    clazz.IsikKorternr = new global::Xtee.Core.Schema.XsdString(Reader.ReadElementString("Isik.Korternr")).Value;
                }
                else {
                    throw new global::Xtee.Core.Exceptions.UnExpectedElementException(">>>>RR62Response>Isik>Isik>Isik.Korternr", Reader.LocalName);
                }
                if (Reader.LocalName=="Isik.Viimatipar") {
                    if (Reader.IsElementNil()) {
                        throw new global::Xtee.Core.Exceptions.NillableNotAllowedException(">>>>RR62Response>Isik>Isik>Isik.Viimatipar");
                    }
                    clazz.IsikViimatipar = new global::Xtee.Core.Schema.XsdString(Reader.ReadElementString("Isik.Viimatipar")).Value;
                }
                else {
                    throw new global::Xtee.Core.Exceptions.UnExpectedElementException(">>>>RR62Response>Isik>Isik>Isik.Viimatipar", Reader.LocalName);
                }
                if (Reader.LocalName=="Isik.Mperenm") {
                    if (Reader.IsElementNil()) {
                        throw new global::Xtee.Core.Exceptions.NillableNotAllowedException(">>>>RR62Response>Isik>Isik>Isik.Mperenm");
                    }
                    clazz.IsikMperenm = new global::Xtee.Core.Schema.XsdString(Reader.ReadElementString("Isik.Mperenm")).Value;
                }
                else {
                    throw new global::Xtee.Core.Exceptions.UnExpectedElementException(">>>>RR62Response>Isik>Isik>Isik.Mperenm", Reader.LocalName);
                }
                if (Reader.LocalName=="Isik.Meesnm") {
                    if (Reader.IsElementNil()) {
                        throw new global::Xtee.Core.Exceptions.NillableNotAllowedException(">>>>RR62Response>Isik>Isik>Isik.Meesnm");
                    }
                    clazz.IsikMeesnm = new global::Xtee.Core.Schema.XsdString(Reader.ReadElementString("Isik.Meesnm")).Value;
                }
                else {
                    throw new global::Xtee.Core.Exceptions.UnExpectedElementException(">>>>RR62Response>Isik>Isik>Isik.Meesnm", Reader.LocalName);
                }
                if (Reader.LocalName=="Isik.IsikKoda") {
                    if (Reader.IsElementNil()) {
                        throw new global::Xtee.Core.Exceptions.NillableNotAllowedException(">>>>RR62Response>Isik>Isik>Isik.IsikKoda");
                    }
                    clazz.IsikIsikKoda = new global::Xtee.Core.Schema.XsdString(Reader.ReadElementString("Isik.IsikKoda")).Value;
                }
                else {
                    throw new global::Xtee.Core.Exceptions.UnExpectedElementException(">>>>RR62Response>Isik>Isik>Isik.IsikKoda", Reader.LocalName);
                }
                if (Reader.LocalName=="Isik.SaabEestisse") {
                    if (Reader.IsElementNil()) {
                        throw new global::Xtee.Core.Exceptions.NillableNotAllowedException(">>>>RR62Response>Isik>Isik>Isik.SaabEestisse");
                    }
                    clazz.IsikSaabEestisse = new global::Xtee.Core.Schema.XsdString(Reader.ReadElementString("Isik.SaabEestisse")).Value;
                }
                else {
                    throw new global::Xtee.Core.Exceptions.UnExpectedElementException(">>>>RR62Response>Isik>Isik>Isik.SaabEestisse", Reader.LocalName);
                }
                if (Reader.LocalName=="Isik.Postiindeks") {
                    if (Reader.IsElementNil()) {
                        throw new global::Xtee.Core.Exceptions.NillableNotAllowedException(">>>>RR62Response>Isik>Isik>Isik.Postiindeks");
                    }
                    clazz.IsikPostiindeks = new global::Xtee.Core.Schema.XsdString(Reader.ReadElementString("Isik.Postiindeks")).Value;
                }
                else {
                    throw new global::Xtee.Core.Exceptions.UnExpectedElementException(">>>>RR62Response>Isik>Isik>Isik.Postiindeks", Reader.LocalName);
                }
                if (Reader.LocalName=="Isik.ElukRegpe") {
                    if (Reader.IsElementNil()) {
                        throw new global::Xtee.Core.Exceptions.NillableNotAllowedException(">>>>RR62Response>Isik>Isik>Isik.ElukRegpe");
                    }
                    clazz.IsikElukRegpe = new global::Xtee.Core.Schema.XsdString(Reader.ReadElementString("Isik.ElukRegpe")).Value;
                }
                else {
                    throw new global::Xtee.Core.Exceptions.UnExpectedElementException(">>>>RR62Response>Isik>Isik>Isik.ElukRegpe", Reader.LocalName);
                }
                if (Reader.LocalName=="Isik.IsikuStaatus") {
                    if (Reader.IsElementNil()) {
                        throw new global::Xtee.Core.Exceptions.NillableNotAllowedException(">>>>RR62Response>Isik>Isik>Isik.IsikuStaatus");
                    }
                    clazz.IsikIsikuStaatus = new global::Xtee.Core.Schema.XsdString(Reader.ReadElementString("Isik.IsikuStaatus")).Value;
                }
                else {
                    throw new global::Xtee.Core.Exceptions.UnExpectedElementException(">>>>RR62Response>Isik>Isik>Isik.IsikuStaatus", Reader.LocalName);
                }
                if (Reader.LocalName=="Isik.KirjeStaatus") {
                    if (Reader.IsElementNil()) {
                        throw new global::Xtee.Core.Exceptions.NillableNotAllowedException(">>>>RR62Response>Isik>Isik>Isik.KirjeStaatus");
                    }
                    clazz.IsikKirjeStaatus = new global::Xtee.Core.Schema.XsdString(Reader.ReadElementString("Isik.KirjeStaatus")).Value;
                }
                else {
                    throw new global::Xtee.Core.Exceptions.UnExpectedElementException(">>>>RR62Response>Isik>Isik>Isik.KirjeStaatus", Reader.LocalName);
                }
                if (Reader.LocalName=="Isik.Synniaeg") {
                    if (Reader.IsElementNil()) {
                        throw new global::Xtee.Core.Exceptions.NillableNotAllowedException(">>>>RR62Response>Isik>Isik>Isik.Synniaeg");
                    }
                    clazz.IsikSynniaeg = new global::Xtee.Core.Schema.XsdString(Reader.ReadElementString("Isik.Synniaeg")).Value;
                }
                else {
                    throw new global::Xtee.Core.Exceptions.UnExpectedElementException(">>>>RR62Response>Isik>Isik>Isik.Synniaeg", Reader.LocalName);
                }
                if (Reader.LocalName=="Isik.Surmaaeg") {
                    if (Reader.IsElementNil()) {
                        throw new global::Xtee.Core.Exceptions.NillableNotAllowedException(">>>>RR62Response>Isik>Isik>Isik.Surmaaeg");
                    }
                    clazz.IsikSurmaaeg = new global::Xtee.Core.Schema.XsdString(Reader.ReadElementString("Isik.Surmaaeg")).Value;
                }
                else {
                    throw new global::Xtee.Core.Exceptions.UnExpectedElementException(">>>>RR62Response>Isik>Isik>Isik.Surmaaeg", Reader.LocalName);
                }
            }
        }
        
        [global::Xtee.Core.Attributes.XmlTypeAttribute(Name=">>>RR62Response>Dok>Dok", Namespace="http://producers.rr.xtee.riik.ee/producer/rr", Target=typeof(RR62Response.DokType))]
        public class DokTypeSerializer : global::Xtee.Core.Types.AbstractXteeSerializable {
            
            protected RR62Response.IDokType clazz;
            
            public DokTypeSerializer(RR62Response.IDokType clazz) {
                this.clazz = clazz;
            }
            
            public override void WriteXml(global::Xtee.Core.IXteeXmlWriter Writer) {
                base.WriteXml(Writer);
                Writer.WriteStartElement("Dok.Isik_iskood");
                if (clazz.DokIsikIskood!=null) {
                    Writer.WriteTypeAttribute("http://www.w3.org/2001/XMLSchema", "string");
                    Writer.WriteString(new global::Xtee.Core.Schema.XsdString(((string)(clazz.DokIsikIskood))).ToString());
                }
                else {
                    throw new global::Xtee.Core.Exceptions.NillableNotAllowedException("Nullable is not allowed for element : DokIsikIskood");
                }
                Writer.WriteEndElement();
                Writer.WriteStartElement("Dok.Dok_iskood");
                if (clazz.DokDokIskood!=null) {
                    Writer.WriteTypeAttribute("http://www.w3.org/2001/XMLSchema", "string");
                    Writer.WriteString(new global::Xtee.Core.Schema.XsdString(((string)(clazz.DokDokIskood))).ToString());
                }
                else {
                    throw new global::Xtee.Core.Exceptions.NillableNotAllowedException("Nullable is not allowed for element : DokDokIskood");
                }
                Writer.WriteEndElement();
                Writer.WriteStartElement("Dok.Dok_perenimi");
                if (clazz.DokDokPerenimi!=null) {
                    Writer.WriteTypeAttribute("http://www.w3.org/2001/XMLSchema", "string");
                    Writer.WriteString(new global::Xtee.Core.Schema.XsdString(((string)(clazz.DokDokPerenimi))).ToString());
                }
                else {
                    throw new global::Xtee.Core.Exceptions.NillableNotAllowedException("Nullable is not allowed for element : DokDokPerenimi");
                }
                Writer.WriteEndElement();
                Writer.WriteStartElement("Dok.Dok_eesnimi");
                if (clazz.DokDokEesnimi!=null) {
                    Writer.WriteTypeAttribute("http://www.w3.org/2001/XMLSchema", "string");
                    Writer.WriteString(new global::Xtee.Core.Schema.XsdString(((string)(clazz.DokDokEesnimi))).ToString());
                }
                else {
                    throw new global::Xtee.Core.Exceptions.NillableNotAllowedException("Nullable is not allowed for element : DokDokEesnimi");
                }
                Writer.WriteEndElement();
                Writer.WriteStartElement("Dok.Dok_osalus");
                if (clazz.DokDokOsalus!=null) {
                    Writer.WriteTypeAttribute("http://www.w3.org/2001/XMLSchema", "string");
                    Writer.WriteString(new global::Xtee.Core.Schema.XsdString(((string)(clazz.DokDokOsalus))).ToString());
                }
                else {
                    throw new global::Xtee.Core.Exceptions.NillableNotAllowedException("Nullable is not allowed for element : DokDokOsalus");
                }
                Writer.WriteEndElement();
                Writer.WriteStartElement("Dok.Teised_Isik_iskood");
                if (clazz.DokTeisedIsikIskood!=null) {
                    Writer.WriteTypeAttribute("http://www.w3.org/2001/XMLSchema", "string");
                    Writer.WriteString(new global::Xtee.Core.Schema.XsdString(((string)(clazz.DokTeisedIsikIskood))).ToString());
                }
                else {
                    throw new global::Xtee.Core.Exceptions.NillableNotAllowedException("Nullable is not allowed for element : DokTeisedIsikIskood");
                }
                Writer.WriteEndElement();
                Writer.WriteStartElement("Dok.Teised_Dok_iskood");
                if (clazz.DokTeisedDokIskood!=null) {
                    Writer.WriteTypeAttribute("http://www.w3.org/2001/XMLSchema", "string");
                    Writer.WriteString(new global::Xtee.Core.Schema.XsdString(((string)(clazz.DokTeisedDokIskood))).ToString());
                }
                else {
                    throw new global::Xtee.Core.Exceptions.NillableNotAllowedException("Nullable is not allowed for element : DokTeisedDokIskood");
                }
                Writer.WriteEndElement();
                Writer.WriteStartElement("Dok.Teised_Dok_perenimi");
                if (clazz.DokTeisedDokPerenimi!=null) {
                    Writer.WriteTypeAttribute("http://www.w3.org/2001/XMLSchema", "string");
                    Writer.WriteString(new global::Xtee.Core.Schema.XsdString(((string)(clazz.DokTeisedDokPerenimi))).ToString());
                }
                else {
                    throw new global::Xtee.Core.Exceptions.NillableNotAllowedException("Nullable is not allowed for element : DokTeisedDokPerenimi");
                }
                Writer.WriteEndElement();
                Writer.WriteStartElement("Dok.Teised_Dok_eesnimi");
                if (clazz.DokTeisedDokEesnimi!=null) {
                    Writer.WriteTypeAttribute("http://www.w3.org/2001/XMLSchema", "string");
                    Writer.WriteString(new global::Xtee.Core.Schema.XsdString(((string)(clazz.DokTeisedDokEesnimi))).ToString());
                }
                else {
                    throw new global::Xtee.Core.Exceptions.NillableNotAllowedException("Nullable is not allowed for element : DokTeisedDokEesnimi");
                }
                Writer.WriteEndElement();
                Writer.WriteStartElement("Dok.Teised_Dok_osalus");
                if (clazz.DokTeisedDokOsalus!=null) {
                    Writer.WriteTypeAttribute("http://www.w3.org/2001/XMLSchema", "string");
                    Writer.WriteString(new global::Xtee.Core.Schema.XsdString(((string)(clazz.DokTeisedDokOsalus))).ToString());
                }
                else {
                    throw new global::Xtee.Core.Exceptions.NillableNotAllowedException("Nullable is not allowed for element : DokTeisedDokOsalus");
                }
                Writer.WriteEndElement();
                Writer.WriteStartElement("Dok.Dok_Nimi");
                if (clazz.DokDokNimi!=null) {
                    Writer.WriteTypeAttribute("http://www.w3.org/2001/XMLSchema", "string");
                    Writer.WriteString(new global::Xtee.Core.Schema.XsdString(((string)(clazz.DokDokNimi))).ToString());
                }
                else {
                    throw new global::Xtee.Core.Exceptions.NillableNotAllowedException("Nullable is not allowed for element : DokDokNimi");
                }
                Writer.WriteEndElement();
                Writer.WriteStartElement("Dok.Dok_Seeria");
                if (clazz.DokDokSeeria!=null) {
                    Writer.WriteTypeAttribute("http://www.w3.org/2001/XMLSchema", "string");
                    Writer.WriteString(new global::Xtee.Core.Schema.XsdString(((string)(clazz.DokDokSeeria))).ToString());
                }
                else {
                    throw new global::Xtee.Core.Exceptions.NillableNotAllowedException("Nullable is not allowed for element : DokDokSeeria");
                }
                Writer.WriteEndElement();
                Writer.WriteStartElement("Dok.Dok_Nr");
                if (clazz.DokDokNr!=null) {
                    Writer.WriteTypeAttribute("http://www.w3.org/2001/XMLSchema", "string");
                    Writer.WriteString(new global::Xtee.Core.Schema.XsdString(((string)(clazz.DokDokNr))).ToString());
                }
                else {
                    throw new global::Xtee.Core.Exceptions.NillableNotAllowedException("Nullable is not allowed for element : DokDokNr");
                }
                Writer.WriteEndElement();
                Writer.WriteStartElement("Dok.Dok_kehtiv_alates");
                if (clazz.DokDokKehtivAlates!=null) {
                    Writer.WriteTypeAttribute("http://www.w3.org/2001/XMLSchema", "string");
                    Writer.WriteString(new global::Xtee.Core.Schema.XsdString(((string)(clazz.DokDokKehtivAlates))).ToString());
                }
                else {
                    throw new global::Xtee.Core.Exceptions.NillableNotAllowedException("Nullable is not allowed for element : DokDokKehtivAlates");
                }
                Writer.WriteEndElement();
                Writer.WriteStartElement("Dok.Dok_kehtiv_kuni");
                if (clazz.DokDokKehtivKuni!=null) {
                    Writer.WriteTypeAttribute("http://www.w3.org/2001/XMLSchema", "string");
                    Writer.WriteString(new global::Xtee.Core.Schema.XsdString(((string)(clazz.DokDokKehtivKuni))).ToString());
                }
                else {
                    throw new global::Xtee.Core.Exceptions.NillableNotAllowedException("Nullable is not allowed for element : DokDokKehtivKuni");
                }
                Writer.WriteEndElement();
                Writer.WriteStartElement("Dok.Dok_kp");
                if (clazz.DokDokKp!=null) {
                    Writer.WriteTypeAttribute("http://www.w3.org/2001/XMLSchema", "string");
                    Writer.WriteString(new global::Xtee.Core.Schema.XsdString(((string)(clazz.DokDokKp))).ToString());
                }
                else {
                    throw new global::Xtee.Core.Exceptions.NillableNotAllowedException("Nullable is not allowed for element : DokDokKp");
                }
                Writer.WriteEndElement();
            }
            
            public override void ReadXml(global::Xtee.Core.IXteeXmlReader Reader) {
                base.ReadXml(Reader);
                if (Reader.LocalName=="Dok.Isik_iskood") {
                    if (Reader.IsElementNil()) {
                        throw new global::Xtee.Core.Exceptions.NillableNotAllowedException(">>>>RR62Response>Dok>Dok>Dok.Isik_iskood");
                    }
                    clazz.DokIsikIskood = new global::Xtee.Core.Schema.XsdString(Reader.ReadElementString("Dok.Isik_iskood")).Value;
                }
                else {
                    throw new global::Xtee.Core.Exceptions.UnExpectedElementException(">>>>RR62Response>Dok>Dok>Dok.Isik_iskood", Reader.LocalName);
                }
                if (Reader.LocalName=="Dok.Dok_iskood") {
                    if (Reader.IsElementNil()) {
                        throw new global::Xtee.Core.Exceptions.NillableNotAllowedException(">>>>RR62Response>Dok>Dok>Dok.Dok_iskood");
                    }
                    clazz.DokDokIskood = new global::Xtee.Core.Schema.XsdString(Reader.ReadElementString("Dok.Dok_iskood")).Value;
                }
                else {
                    throw new global::Xtee.Core.Exceptions.UnExpectedElementException(">>>>RR62Response>Dok>Dok>Dok.Dok_iskood", Reader.LocalName);
                }
                if (Reader.LocalName=="Dok.Dok_perenimi") {
                    if (Reader.IsElementNil()) {
                        throw new global::Xtee.Core.Exceptions.NillableNotAllowedException(">>>>RR62Response>Dok>Dok>Dok.Dok_perenimi");
                    }
                    clazz.DokDokPerenimi = new global::Xtee.Core.Schema.XsdString(Reader.ReadElementString("Dok.Dok_perenimi")).Value;
                }
                else {
                    throw new global::Xtee.Core.Exceptions.UnExpectedElementException(">>>>RR62Response>Dok>Dok>Dok.Dok_perenimi", Reader.LocalName);
                }
                if (Reader.LocalName=="Dok.Dok_eesnimi") {
                    if (Reader.IsElementNil()) {
                        throw new global::Xtee.Core.Exceptions.NillableNotAllowedException(">>>>RR62Response>Dok>Dok>Dok.Dok_eesnimi");
                    }
                    clazz.DokDokEesnimi = new global::Xtee.Core.Schema.XsdString(Reader.ReadElementString("Dok.Dok_eesnimi")).Value;
                }
                else {
                    throw new global::Xtee.Core.Exceptions.UnExpectedElementException(">>>>RR62Response>Dok>Dok>Dok.Dok_eesnimi", Reader.LocalName);
                }
                if (Reader.LocalName=="Dok.Dok_osalus") {
                    if (Reader.IsElementNil()) {
                        throw new global::Xtee.Core.Exceptions.NillableNotAllowedException(">>>>RR62Response>Dok>Dok>Dok.Dok_osalus");
                    }
                    clazz.DokDokOsalus = new global::Xtee.Core.Schema.XsdString(Reader.ReadElementString("Dok.Dok_osalus")).Value;
                }
                else {
                    throw new global::Xtee.Core.Exceptions.UnExpectedElementException(">>>>RR62Response>Dok>Dok>Dok.Dok_osalus", Reader.LocalName);
                }
                if (Reader.LocalName=="Dok.Teised_Isik_iskood") {
                    if (Reader.IsElementNil()) {
                        throw new global::Xtee.Core.Exceptions.NillableNotAllowedException(">>>>RR62Response>Dok>Dok>Dok.Teised_Isik_iskood");
                    }
                    clazz.DokTeisedIsikIskood = new global::Xtee.Core.Schema.XsdString(Reader.ReadElementString("Dok.Teised_Isik_iskood")).Value;
                }
                else {
                    throw new global::Xtee.Core.Exceptions.UnExpectedElementException(">>>>RR62Response>Dok>Dok>Dok.Teised_Isik_iskood", Reader.LocalName);
                }
                if (Reader.LocalName=="Dok.Teised_Dok_iskood") {
                    if (Reader.IsElementNil()) {
                        throw new global::Xtee.Core.Exceptions.NillableNotAllowedException(">>>>RR62Response>Dok>Dok>Dok.Teised_Dok_iskood");
                    }
                    clazz.DokTeisedDokIskood = new global::Xtee.Core.Schema.XsdString(Reader.ReadElementString("Dok.Teised_Dok_iskood")).Value;
                }
                else {
                    throw new global::Xtee.Core.Exceptions.UnExpectedElementException(">>>>RR62Response>Dok>Dok>Dok.Teised_Dok_iskood", Reader.LocalName);
                }
                if (Reader.LocalName=="Dok.Teised_Dok_perenimi") {
                    if (Reader.IsElementNil()) {
                        throw new global::Xtee.Core.Exceptions.NillableNotAllowedException(">>>>RR62Response>Dok>Dok>Dok.Teised_Dok_perenimi");
                    }
                    clazz.DokTeisedDokPerenimi = new global::Xtee.Core.Schema.XsdString(Reader.ReadElementString("Dok.Teised_Dok_perenimi")).Value;
                }
                else {
                    throw new global::Xtee.Core.Exceptions.UnExpectedElementException(">>>>RR62Response>Dok>Dok>Dok.Teised_Dok_perenimi", Reader.LocalName);
                }
                if (Reader.LocalName=="Dok.Teised_Dok_eesnimi") {
                    if (Reader.IsElementNil()) {
                        throw new global::Xtee.Core.Exceptions.NillableNotAllowedException(">>>>RR62Response>Dok>Dok>Dok.Teised_Dok_eesnimi");
                    }
                    clazz.DokTeisedDokEesnimi = new global::Xtee.Core.Schema.XsdString(Reader.ReadElementString("Dok.Teised_Dok_eesnimi")).Value;
                }
                else {
                    throw new global::Xtee.Core.Exceptions.UnExpectedElementException(">>>>RR62Response>Dok>Dok>Dok.Teised_Dok_eesnimi", Reader.LocalName);
                }
                if (Reader.LocalName=="Dok.Teised_Dok_osalus") {
                    if (Reader.IsElementNil()) {
                        throw new global::Xtee.Core.Exceptions.NillableNotAllowedException(">>>>RR62Response>Dok>Dok>Dok.Teised_Dok_osalus");
                    }
                    clazz.DokTeisedDokOsalus = new global::Xtee.Core.Schema.XsdString(Reader.ReadElementString("Dok.Teised_Dok_osalus")).Value;
                }
                else {
                    throw new global::Xtee.Core.Exceptions.UnExpectedElementException(">>>>RR62Response>Dok>Dok>Dok.Teised_Dok_osalus", Reader.LocalName);
                }
                if (Reader.LocalName=="Dok.Dok_Nimi") {
                    if (Reader.IsElementNil()) {
                        throw new global::Xtee.Core.Exceptions.NillableNotAllowedException(">>>>RR62Response>Dok>Dok>Dok.Dok_Nimi");
                    }
                    clazz.DokDokNimi = new global::Xtee.Core.Schema.XsdString(Reader.ReadElementString("Dok.Dok_Nimi")).Value;
                }
                else {
                    throw new global::Xtee.Core.Exceptions.UnExpectedElementException(">>>>RR62Response>Dok>Dok>Dok.Dok_Nimi", Reader.LocalName);
                }
                if (Reader.LocalName=="Dok.Dok_Seeria") {
                    if (Reader.IsElementNil()) {
                        throw new global::Xtee.Core.Exceptions.NillableNotAllowedException(">>>>RR62Response>Dok>Dok>Dok.Dok_Seeria");
                    }
                    clazz.DokDokSeeria = new global::Xtee.Core.Schema.XsdString(Reader.ReadElementString("Dok.Dok_Seeria")).Value;
                }
                else {
                    throw new global::Xtee.Core.Exceptions.UnExpectedElementException(">>>>RR62Response>Dok>Dok>Dok.Dok_Seeria", Reader.LocalName);
                }
                if (Reader.LocalName=="Dok.Dok_Nr") {
                    if (Reader.IsElementNil()) {
                        throw new global::Xtee.Core.Exceptions.NillableNotAllowedException(">>>>RR62Response>Dok>Dok>Dok.Dok_Nr");
                    }
                    clazz.DokDokNr = new global::Xtee.Core.Schema.XsdString(Reader.ReadElementString("Dok.Dok_Nr")).Value;
                }
                else {
                    throw new global::Xtee.Core.Exceptions.UnExpectedElementException(">>>>RR62Response>Dok>Dok>Dok.Dok_Nr", Reader.LocalName);
                }
                if (Reader.LocalName=="Dok.Dok_kehtiv_alates") {
                    if (Reader.IsElementNil()) {
                        throw new global::Xtee.Core.Exceptions.NillableNotAllowedException(">>>>RR62Response>Dok>Dok>Dok.Dok_kehtiv_alates");
                    }
                    clazz.DokDokKehtivAlates = new global::Xtee.Core.Schema.XsdString(Reader.ReadElementString("Dok.Dok_kehtiv_alates")).Value;
                }
                else {
                    throw new global::Xtee.Core.Exceptions.UnExpectedElementException(">>>>RR62Response>Dok>Dok>Dok.Dok_kehtiv_alates", Reader.LocalName);
                }
                if (Reader.LocalName=="Dok.Dok_kehtiv_kuni") {
                    if (Reader.IsElementNil()) {
                        throw new global::Xtee.Core.Exceptions.NillableNotAllowedException(">>>>RR62Response>Dok>Dok>Dok.Dok_kehtiv_kuni");
                    }
                    clazz.DokDokKehtivKuni = new global::Xtee.Core.Schema.XsdString(Reader.ReadElementString("Dok.Dok_kehtiv_kuni")).Value;
                }
                else {
                    throw new global::Xtee.Core.Exceptions.UnExpectedElementException(">>>>RR62Response>Dok>Dok>Dok.Dok_kehtiv_kuni", Reader.LocalName);
                }
                if (Reader.LocalName=="Dok.Dok_kp") {
                    if (Reader.IsElementNil()) {
                        throw new global::Xtee.Core.Exceptions.NillableNotAllowedException(">>>>RR62Response>Dok>Dok>Dok.Dok_kp");
                    }
                    clazz.DokDokKp = new global::Xtee.Core.Schema.XsdString(Reader.ReadElementString("Dok.Dok_kp")).Value;
                }
                else {
                    throw new global::Xtee.Core.Exceptions.UnExpectedElementException(">>>>RR62Response>Dok>Dok>Dok.Dok_kp", Reader.LocalName);
                }
            }
        }
    }
}
